package com.example.coffeeseller_2.model.beans;

import android.graphics.Bitmap;

import com.example.coffeeseller_2.model.factory.BuyState;

/**
 * Created by WH on 2018/8/3.
 * 被选中的咖啡信息类,全局静态类
 */

public class ChooseCoffeeInfo {
    private static ChooseCoffeeInfo instance;
    private int locationX;
    private int locationY;
    private int minWidth;
    private int minHeight;
    private Bitmap cacheImage;
    private Bitmap cropImage;
    private Coffee coffee;
    private BuyState buyState = BuyState.NONE;

    public static ChooseCoffeeInfo getInstance() {
        if (instance == null) {
            instance = new ChooseCoffeeInfo();
        }
        return instance;
    }

    public boolean isVilid() {

        return coffee != null;
    }

    public void clear() {
        locationX = 0;
        locationY = 0;
        cacheImage = null;
        cropImage = null;
        coffee = null;
    }

    public int getLocationX() {
        return locationX;
    }

    public void setLocationX(int locationX) {
        this.locationX = locationX;
    }

    public int getMinWidth() {
        return minWidth;
    }

    public void setMinWidth(int minWidth) {
        this.minWidth = minWidth;
    }

    public int getMinHeight() {
        return minHeight;
    }

    public void setMinHeight(int minHeight) {
        this.minHeight = minHeight;
    }

    public int getLocationY() {
        return locationY;
    }

    public void setLocationY(int locationY) {
        this.locationY = locationY;
    }

    public Bitmap getCacheImage() {
        return cacheImage;
    }

    public void setCacheImage(Bitmap cacheImage) {
        this.cacheImage = cacheImage;
    }

    public Bitmap getCropImage() {
        return cropImage;
    }

    public void setCropImage(Bitmap cropImage) {
        this.cropImage = cropImage;
    }

    public Coffee getCoffee() {
        return coffee;
    }

    public void setCoffee(Coffee coffee) {
        this.coffee = coffee;
    }

    public BuyState getBuyState() {
        return buyState;
    }

    public void setBuyState(BuyState buyState) {
        this.buyState = buyState;
    }
}
